/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.home.tax.services;

import java.util.List;
import org.home.tax.dao.HoSoRepository;
import org.home.tax.model.HoSo;

/**
 *
 * @author TIN Nguyen
 */
public class TaxServices {
    
    public Object[][] constructHoSoTableModel(int colSize){
        Object[][] ret; 
        HoSoRepository hsRepo = new HoSoRepository();
        List<HoSo> hosos = hsRepo.findAll();
        int row = hosos.size();
        int col = colSize;
        ret = new Object[row][col];
        
        int rowWalk = 0;
        for(HoSo hoso : hosos){
            int colWalk = 0;
            ret[rowWalk][colWalk++] = hoso.getStt(); //STT
            ret[rowWalk][colWalk++] = hoso.getMaSoThue().getMaSoThue(); //Ma So Thue
            ret[rowWalk][colWalk++] = hoso.getMaSoThue().getTenDoanhNghiep();
            ret[rowWalk][colWalk++] = hoso.getMaSoThue().getDiaChi();
            ret[rowWalk][colWalk++] = hoso.getCongChucGiuNS();
            ret[rowWalk][colWalk++] = hoso.getTruongDoan();
            ret[rowWalk][colWalk++] = hoso.getTienDo(); //Tinh trang
            ret[rowWalk][colWalk++] = hoso.getDateTaoHoSo();
            ret[rowWalk][colWalk++] = "TODO"; //Canh Bao
            ret[rowWalk][colWalk++] = "TODO";   //Hoan Thanh
            
            rowWalk++;
        }
        
        return ret;
    }
}
